package practice.annotaion.spring.door;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import practice.annotaion.spring.entrance.AlarmDevice;
import practice.annotaion.spring.entrance.AlarmDeviceSms;
import practice.annotaion.spring.entrance.Camera;
import practice.annotaion.spring.entrance.DisplayStrategy;
import practice.annotaion.spring.entrance.DisplayStrategyDefault;
import practice.annotaion.spring.entrance.HomeController;
import practice.annotaion.spring.entrance.InfraredRaySensor;
import practice.annotaion.spring.entrance.Recorder;
import practice.annotaion.spring.entrance.Viewer;
import practice.annotaion.spring.entrance.ViewerMonitor;

@Configuration
public class ConfigAutowired {
	@Bean
	public Camera camera1() {
		return new Camera();
	}

	@Bean
	public Camera camera2() {
		return new Camera();
	}

	@Bean
	public Camera camera3() {
		return new Camera();
	}

	@Bean
	public Camera camera4() {
		return new Camera();
	}

	@Bean
	@Qualifier("intrusionDetection")
	public InfraredRaySensor windowSensor() {
		return new InfraredRaySensor("창 센서");
	}

	@Bean
	@Qualifier("intrusionDetection")
	public InfraredRaySensor doorSensor() {
		return new InfraredRaySensor("문 센서");
	}

	@Bean
	public InfraredRaySensor lampSensor() {
		return new InfraredRaySensor("등 센서");
	}

	@Bean
	public AlarmDevice alarmDevice() {
		return new AlarmDeviceSms();
	}

	@Bean
	public Viewer viewer() {
		return new ViewerMonitor();
	}

	@Bean
	public HomeController homeController() {
		return new HomeController();
	}

	@Bean
	@Qualifier("main")
	public Recorder recorder() {
		return new Recorder();
	}

	@Bean
	public DisplayStrategy displayStrategy() {
		return new DisplayStrategyDefault();
	}
}
